import random

print('---------------------文字游戏123------------------')
begin = 100
end = 200
allcount = 10
print('猜数字,范围是从{}到{}'.format(begin,end))
answer = random.randint(100,200)
playcount = 0
while(1):
    if allcount == 0:
        pass
    else:
        playcount = playcount + 1
        print('一共有{}次机会,这是第{}次机会，还剩{}次机会'.format(allcount,playcount,(allcount-playcount)))
        if playcount > allcount:
            break
    temp = input('请输入一个数字:')
    guess = int(temp)
    if guess > answer:
        print('大了')
    elif guess < answer:
        print('小了')
    else:
        print('猜对了，牛掰,你共用了{}次机会'.format(playcount))
        break
print('游戏结束')